<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>支付结果</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }
        body {
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
        }
        .container {
            max-width: 800px;
            margin: 50px auto;
            padding: 30px;
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        .header {
            margin-bottom: 30px;
        }
        .header h1 {
            color: #1677ff;
            font-size: 24px;
            font-weight: 500;
        }
        .result-icon {
            font-size: 60px;
            margin-bottom: 20px;
        }
        .success-icon {
            color: #52c41a;
        }
        .fail-icon {
            color: #f5222d;
        }
        .result-info {
            margin-bottom: 30px;
        }
        .result-info p {
            margin-bottom: 10px;
            font-size: 16px;
        }
        .amount {
            font-size: 28px;
            font-weight: bold;
            color: #1677ff;
            margin: 10px 0;
        }
        .btn {
            background-color: #1677ff;
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 6px;
            font-size: 16px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            margin-top: 20px;
        }
        .btn:hover {
            background-color: #0e5edb;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>支付结果</h1>
        </div>
        
        <div id="result-container">
            <!-- 此处由JavaScript动态填充内容 -->
        </div>
        
        <a href="/pay" class="btn">返回首页</a>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const resultContainer = document.getElementById('result-container');
            
            // 从URL参数中获取支付结果信息
            const params = new URLSearchParams(window.location.search);
            const orderNo = params.get('orderNo');
            const tradeNo = params.get('tradeNo');
            const amount = params.get('amount');
            const payStatus = params.get('payStatus');
            
            let resultHtml = '';
            
            if (payStatus === '1') {
                // 支付成功
                resultHtml = `
                    <div class="result-icon success-icon">✓</div>
                    <div class="result-info">
                        <h2>支付成功</h2>
                        <div class="amount">¥${amount}</div>
                        <p>订单号: ${orderNo}</p>
                        <p>交易号: ${tradeNo}</p>
                    </div>
                `;
            } else {
                // 支付失败或未知状态
                resultHtml = `
                    <div class="result-icon fail-icon">✕</div>
                    <div class="result-info">
                        <h2>支付失败</h2>
                        <p>订单号: ${orderNo || '未知'}</p>
                        ${amount ? `<div class="amount">¥${amount}</div>` : ''}
                        <p>请重新尝试支付或联系客服</p>
                    </div>
                `;
            }
            
            resultContainer.innerHTML = resultHtml;
        });
    </script>
</body>
</html> 